home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Draw / Include / ToolFrm.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  3.3 KB  |  105 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                ToolFrm.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef TOOLFRM_H
  13. #define TOOLFRM_H
  14.  
  15. #ifndef UTILS_H
  16. #include "Utils.h"
  17. #endif
  18.  
  19. #ifndef FLOATFRM_H
  20. #include "FloatFrm.h"
  21. #endif
  22.  
  23. //========================================================================================
  24. // Constants
  25. //========================================================================================
  26.  
  27. const unsigned short kToolCellSize = 21;
  28.  
  29. const unsigned short kToolWidth = 1 + kToolCellSize + 1 + kToolCellSize + 1;
  30. const unsigned short kToolHeight = 1 + kToolCellSize + 1 + kToolCellSize + 1 + kToolCellSize + 1;
  31.  
  32. const unsigned short kSelectorHeight = 12;
  33. const short kFillFrameSelectorPos = 2 + kToolHeight + 2;
  34.  
  35. const unsigned short kColorSelectorWidth = kToolWidth - 4;
  36. const unsigned short kColorSelectorHeight = 30;
  37.  
  38. const unsigned short kToolsWindowWidth = 2 + kToolWidth + 2;
  39. const unsigned short kToolsWindowHeight = 2 + kToolHeight + 2 + kSelectorHeight + 2 + 2 + 4 + kColorSelectorHeight + 4;
  40.  
  41. //========================================================================================
  42. // Forward Declaration
  43. //========================================================================================
  44.  
  45. #if FW_LIB_EXPORT_PRAGMAS
  46. #pragma import on
  47. #endif
  48. class FW_CLASS_ATTR FW_CFacetContext;
  49. class FW_CLASS_ATTR FW_CMouseEvent;
  50. class FW_CLASS_ATTR FW_CFacetContext;
  51. #if FW_LIB_EXPORT_PRAGMAS
  52. #pragma import off
  53. #endif
  54.  
  55. //========================================================================================
  56. // CToolFrame
  57. //========================================================================================
  58.  
  59. class FW_CLASS_ATTR CToolFrame : public CFloatingWindowFrame
  60. {
  61. //----------------------------------------------------------------------------------------
  62. // Initialization/destruction
  63. //
  64. public:        
  65.     CToolFrame(Environment *ev, ODFrame* odFrame, FW_CPresentation* presentation, CDrawPart* drawPart);
  66.     virtual ~ CToolFrame();
  67.  
  68. //----------------------------------------------------------------------------------------
  69. // Inherited
  70. //
  71. public:    
  72.     virtual void             Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape);
  73.     virtual FW_Boolean        DoMouseDown(Environment *ev, const FW_CMouseEvent& theMouseEvent);
  74.     
  75. //----------------------------------------------------------------------------------------
  76. // New API
  77. //
  78. public:
  79.     void                    CheckTool(Environment *ev, 
  80.                                         unsigned short oldTool, 
  81.                                           unsigned short newTool);
  82.     void                    CheckRenderVerb(Environment *ev, 
  83.                                             unsigned short oldRenderVerb, 
  84.                                                  unsigned short newRenderVerb);
  85.     void                    UpdateColors(Environment *ev);
  86.     
  87. private:
  88.     void                    InvertTool(FW_CFacetContext& fc, unsigned short theTool, FW_Boolean state);
  89.     void                    DrawRenderVerb(FW_CFacetContext& fc, 
  90.                                             unsigned short renderVerb, 
  91.                                             const FW_CColor& color);
  92.     void                    DrawTools(FW_CFacetContext& fc);
  93.     void                    DrawColors(FW_CFacetContext& fc);
  94.     
  95.     
  96. //----------------------------------------------------------------------------------------
  97. // Data Members
  98. //
  99. private:    
  100.     CGrid                    fToolGrid;
  101.     CGrid                    fFillFrameGrid;
  102. };
  103.  
  104. #endif
  105.